/**
 * 
 */
package fr.utbm.gi.in56.user;

import java.io.Serializable;

/**
 * Implementation of a user JavaBean.
 *
 * @author Adrien Hoffer & Tarik Belabbas
 *
 */
public class UserBean implements Serializable
{
	/**
	 * Version number associated to the serializable class.
	 */
	private static final long	serialVersionUID	= 2443484333521045463L;

	/**
	 * The user name.
	 */
	private String			login;
	
	/**
	 * The admin status.
	 */
	private boolean			isAdmin;
	
	/**
	 * The number of unread messages
	 */
	private int				unreadMessagesNb;
	
	/**
	 * The county of the user.
	 */
	private int				county;

	/**
	 * Default constructor.
	 */
	public UserBean()
	{
		this.isAdmin			= false;
		this.unreadMessagesNb	= 0;
	}

	/**
	 * Returns the user name.
	 * 
	 * @return the user name
	 */
	public String getLogin()
	{
		return this.login;
	}

	/**
	 * Sets the user name.
	 * 
	 * @param _login the new user name
	 */
	public void setLogin( String _login )
	{
		this.login = _login;
	}
	
	/**
	 * Returns the admin status.
	 * 
	 * @return <tt>true</tt> if the user is admin.
	 */
	public boolean isAdmin()
	{
		return this.isAdmin;
	}
	
	/**
	 * Sets the admin status.
	 * 
	 * @param _isAdmin the new admin status
	 */
	public void setIsAdmin( boolean _isAdmin )
	{
		this.isAdmin = _isAdmin;
	}

	/**
	 * Set the number of unread messages.
	 * 
	 * @param unreadMessagesNb the new number of unread messages
	 */
	public void setUnreadMessages(int unreadMessagesNb)
	{
		this.unreadMessagesNb = unreadMessagesNb;
	}

	/**
	 * Returns the number of unread messages.
	 * 
	 * @return the number of unread messages
	 */
	public int getUnreadMessagesNb()
	{
		return this.unreadMessagesNb;
	}

	/**
	 * Sets the county.
	 * 
	 * @param _county the new county
	 */
	public void setCounty( int _county )
	{
		this.county = _county;		
	}
	
	/**
	 * Returns the county.
	 * 
	 * @return the county
	 */
	public int getCounty()
	{
		return this.county;
	}
}
